<template>
  <div>
    <p>第十五章（全局组件，局部组件，递归组件）</p>
    <hr />
    <div>
      <div>
        <TreeVue :data="treeData"></TreeVue>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { reactive } from 'vue'
import TreeVue from '@/components/15th/Tree.vue'

interface Tree {
  name: string
  checked: boolean
  children?: Tree[]
}

const treeData = reactive<Tree[]>([
  {
    name: '1',
    checked: false,
    children: [
      {
        name: '1-1',
        checked: false,
      },
    ],
  },
  {
    name: '2',
    checked: false,
  },
  {
    name: '3',
    checked: false,
    children: [
      {
        name: '3-1',
        checked: false,
        children: [
          {
            name: '3-1-1',
            checked: true,
          },
          {
            name: '3-1-2',
            checked: false,
          },
        ],
      },
    ],
  },
])
</script>
<style scoped></style>
